package com.mjh.zhujianju.enums;

/**
 * @author: Alex
 * @version: V1.0
 * @project: zhujianju
 * @package: com.mjh.zhujianju.enums
 * @description: description
 * @date: 2018/8/19
 * @time: 下午5:50
 */
public enum RemindEnum {
    INTERVAL15("15","15分钟"),
    INTERVAL30("30","30分钟"),
    INTERVAL50("50","50分钟");

    private String code;
    private String name;

    RemindEnum(String code, String name) {
        this.code = code;
        this.name = name;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public static RemindEnum[] getEnums(){
        return RemindEnum.values();
    }

    public static String getName(String code){
        if(code == null){
            return null;
        }

        for (RemindEnum remindEnum : RemindEnum.values()){
            if(code.equals(remindEnum.getCode())){
                return remindEnum.getName();
            }
        }

        return null;
    }
}
